# Contributor: Gabor Csardi <csardi.gabor@gmail.com>
# Maintainer: Gabor Csardi <csardi.gabor@gmail.com>
pkgname=udunits
pkgver=2.2.28
pkgrel=0
pkgdesc="Library for handling of units of physical quantities"
url="https://www.unidata.ucar.edu/software/udunits/"
arch="all"
license="UCAR"
makedepends="expat-dev"
checkdepends="cunit-dev"
subpackages="$pkgname-dev $pkgname-doc"
source="https://downloads.unidata.ucar.edu/udunits/$pkgver/udunits-$pkgver.tar.gz"

prepare() {
	default_prepare

	update_config_guess
	update_config_sub
}

build() {
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--sysconfdir=/etc \
		--mandir=/usr/share/man \
		--localstatedir=/var
	make
}

check() {
	make check
}

package() {
	make DESTDIR="$pkgdir" install
}

sha512sums="
86146d489e1d472723e059fb15a5dd697a67568ffb5cdba17d191eb304c018bffffea708a73cce50a6c87ad33b387e5ee6653377ae0ebe9986117dfd41e9a5a1  udunits-2.2.28.tar.gz
"
